// index.js
// 获取应用实例
const app = getApp()

Page({
  data: {
    info:''
  },
  
  onLoad() {
    let that = this;
    wx.request({
      url: app.globalData.baseUrl + '/api/my/userInfo',
      method: 'GET',
      header: {
        'content-type': 'application/x-www-form-urlencoded',
        'token':app.globalData.token,
      },
      success: function(res) {   
        console.log(res)
        if(res.data.status){
          that.setData({
            info:res.data.data.records
          })
          if(!res.data.data.records.get_driver_info){
            wx.showModal({
              title: '提示',
              content: '请先激活',
              showCancel:false,
              success (res) {
                wx.switchTab({
                  url: '/pages/my/index',
                })
              }
            })
          }
        }              
        console.log(res)
      },
      fail: function() {
        console.log("请求失败")
      }
    })
  },
 
  
 
})
